home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / DOpus_SDK_5.5 / examples / module / example.c < prev    next >
C/C++ Source or Header  |  1996-09-01  |  1KB  |  49 lines

  1. #include "example.h"
  2. #include <string.h>
  3.  
  4. // Define the version string here
  5. static char *version="$VER: example.module 1.0 (01.08.96)";
  6.  
  7. // Main entry point to the module. The L_ is to identify this as a library
  8. // function (specified by the "libprefix" option in the makefile)
  9. int __asm __saveds L_Module_Entry(
  10.     register __a0 char *args,                // User-supplied arguments
  11.     register __a1 struct Screen *screen,    // Screen to open on
  12.     register __a2 IPCData *ipc,                // Our IPC pointer
  13.     register __a3 IPCData *main_ipc,        // Main Opus IPC pointer
  14.     register __d0 ULONG mod_id,                // ID of module function
  15.     register __d1 EXT_FUNC(func_callback))    // Opus callback function
  16. {
  17.     char buf[256];
  18.  
  19.     // Build requester text
  20.     strcpy(buf,DOpusGetString(locale,MSG_MESSAGE));
  21.  
  22.     // If arguments were supplied, tack them on the end
  23.     if (args && *args)
  24.     {
  25.         // Add args to end of buffer
  26.         strcat(buf,"\nArgs: ");
  27.         strcat(buf,args);
  28.  
  29.         // The argument string is supplied with a newline character for use
  30.         // with ReadArgs().. we strip it for the requester
  31.         buf[strlen(buf)-1]=0;
  32.     }
  33.  
  34.     // Display requester
  35.     AsyncRequestTags(
  36.         ipc,
  37.         REQTYPE_SIMPLE,
  38.         0,
  39.         0,
  40.         0,
  41.         AR_Screen,screen,
  42.         AR_Message,buf,
  43.         AR_Title,DOpusGetString(locale,MSG_TITLE),
  44.         AR_Button,DOpusGetString(locale,MSG_OK),
  45.         TAG_END);
  46.  
  47.     return 1;
  48. }
  49.